<!DOCTYPE html>
<html>

	<head lang="en">
		<title>找攻略</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/myStrategyComment.css" />
		<script src="/js/plugins/jrender/jrender.js"></script>
		<script src="/js/plugins/jquery-form/jquery.form.js"></script>
		<link rel="stylesheet" href="/js/plugins/dialog/dialog.css">
		<script src="/js/plugins/dialog/dialog.min.js"></script>
		<!--<link rel="stylesheet" href="/js/plugins/jquery-confirm/css/jquery-confirm.css">
		<script src="/js/plugins/jquery-confirm/js/jquery-confirm.js"></script>-->
		<script src="/js/common.js"></script>
		<script src="/js/myJs.js"></script>



		<link rel="stylesheet" type="text/css" href="/js/plugins/WebUploader/css/webuploader.css" />
		<link rel="stylesheet" type="text/css" href="/js/plugins/WebUploader/examples/image-upload/style.css" />


	</head>

	<body>
	<div class="search-head">
		<div class="row nav-search">
			<div class="col">
				<a href="javascript:window.history.go(-1)">
					<span><i class="fa fa-chevron-left" ></i></span>
				</a>

			</div>
			<div class="col">
				<span>点评</span>
			</div>
			<div class="col"></div>
		</div>
	</div>

	<div class="comment">
		<div class="container star">
			<p>你对该旅游地的评价</p>
			<i class="fa fa-star-o fa-lg" style="color: #DFE823" data-num="1"></i>
			<i class="fa fa-star-o fa-lg" style="color: #DFE823" data-num="2"></i>
			<i class="fa fa-star-o fa-lg" style="color: #DFE823" data-num="3"></i>
			<i class="fa fa-star-o fa-lg" style="color: #DFE823" data-num="4"></i>
			<i class="fa fa-star-o fa-lg" style="color: #DFE823" data-num="5"></i>
		</div>
		<script>

			var strategyId;
            $(function () {
                strategyId = getParams().strategyId;
                console.log(strategyId);
                $("input[name='strategyId']").val(strategyId);
                $("#submitBtn").click(function () {
                    //改为异步表单
                    $("#editForm").ajaxSubmit(function (data) {
                        $(document).dialog({
                            type: "confirm",
                            style: "IOS",
                            titleShow: false,
                            content: "提交成功",
                            buttons: [{
                                name: "跳转",
                                callback: function () {
                                    location.href = "/strategyCatalogs.html?strategyId=" + strategyId;
                                }
                            }]
                        });
                    });
                });

                //点星星的
                $(".fa-lg").click(function () {
                    $(".fa-lg").attr("class", "fa fa-star-o fa-lg")
                    var num = $(this).data("num");
                    $("input[name='star']").val(num);
                    for (var i = 1; i <= num; i++) {
                        $('i[data-num=' + i + ']').attr("class", "fa fa-star fa-lg")
                    }
                });
                //回显最多人评论的五个标签给游客选择
				$.get("/comments/tags",function (data) {
				    $.each(data,function (index,item) {
                        $("<label class=\"btn btn-outline-danger \"><input name='tags' type=\"checkbox\" " +
							"autocomplete=\"off\" value="+item.id+">"+item.content+"</label>").appendTo("#tag");
				    })
                })
            })
		</script>
		<hr />
		<div class="container tag">
			<form action="/comments/tags" method="post" id="editForm">
			<p>请为该旅游地选择合适的标签（大家都在评）</p>
			<div class="btn-group-toggle" data-toggle="buttons" id="tag">
				<label class="btn btn-outline-danger ">
					<input type="checkbox" autocomplete="off" value="价格便宜"> 价格便宜
				</label>

			</div>

			<p>添加你自己的标签</p>
			<input name="myTags" class="form-control"  placeholder="请使用空格隔开标签，每个标签不超8个字"   />
			<p>更多评价内容</p>
				<!--保存回显图片的url-->
				<input type="hidden" name="picUrl" value="">
				<input type="hidden" name="strategyId" value="">
				<input type="hidden" name="star" value="">
			<textarea name="content" class="form-control" rows="5" placeholder="请填写你对该旅游地的评价"></textarea>
			</form>
		</div>

		<div id="wrapper">
			<div id="container">
				<!--头部，相册选择和格式选择-->

				<div id="uploader">
					<div class="queueList">
						<div id="dndArea" class="placeholder">
							<div id="filePicker"></div>
							<p>或将照片拖到这里，单次最多可选8张</p>
						</div>
					</div>
					<div class="statusBar" style="display:none;">
						<div class="progress">
							<span class="text">0%</span>
							<span class="percentage"></span>
						</div><div class="info"></div>
						<div class="btns">
							<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="/js/plugins/WebUploader/dist/webuploader.js"></script>
		<script type="text/javascript" src="/js/plugins/WebUploader/examples/image-upload/upload.js"></script>

	</div>

	<div class="operation">
		<button class="btn" onclick="window.history.go(-1)">放弃评价</button>
		<button class="btn" id="submitBtn">提交评价</button>
	</div>



	</body>


</html>